﻿using System;
using System.Web.UI.WebControls;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.Web.UI;
using Ue.Qcdz.Domain;
using Ue.Qcdz.Domain.SaleInfos;
using Ue.Framework.Web.WebControls;
namespace Ue.Qcdz.UI.Controls.SaleInfo
{
    public class SaleInfoGirdView : SkinnedGridView
    {
        #region Overrides of SkinnedControl

        private string skinFileName = "~/Admin/Themes/Skins/SaleInfo/SaleInfoView.ascx";
        private SaleInfoIsTopRadio saleInfoTopRadio;
        private SaleInfoIsHotRadio saleInfoHotRadio;
        public string Title { get; set; }
        public string KeyWord { get; set; }
        public string Type { get; set; }
        public string IsTop { get; set; }
        public string IsHot { get; set; }
        public SaleInfoGirdView()
        {
            this.Title = SiteContext.GetSiteContext().SalteTitle;
            this.KeyWord = SiteContext.GetSiteContext().KeyWord;
            this.Type = SiteContext.GetSiteContext().SalesType;
            this.IsTop = SiteContext.GetSiteContext().IsTop;
            this.IsHot = SiteContext.GetSiteContext().IsHot;
        }

        protected override string GetSkinFileName()
        {
            return skinFileName;
        }

        #endregion

        #region Overrides of SkinnedGridView
        protected override void InitializeSkin(System.Web.UI.Control skin)
        {
            base.InitializeSkin(skin);
            saleInfoTopRadio = skin.FindControl<SaleInfoIsTopRadio>("SaleInfoIsTopRadio1");
            saleInfoHotRadio = skin.FindControl<SaleInfoIsHotRadio>("SaleInfoIsHotRadio1");
        }
        protected override void GridViewDataBind(object sender, EventArgs args)
        {
            IDataResult<Ue.Qcdz.Domain.SaleInfos.SaleInfo> dataResult = SaleInfoService.GetSaleInfo(this);
            Repeater repeater = sender as Repeater;
            repeater.DataSource = dataResult.DataObjects;
            repeater.DataBind();
            this.RecordCount = dataResult.RecordCount;
        }

        #endregion
    }
}
